package com.base;

import javax.swing.plaf.TableHeaderUI;

public class TestSleep {
    public  static  void main(String [] args){
        Runnable runnable=new Runnable() {
            public void run() {
                while(true)
                {
                    try {
                        Thread.sleep(1000);//该线程休息1秒钟
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                    System.out.println("线程——"+ Thread.currentThread().getName());
                }
            }
        };

        new Thread(runnable).start();

    }
}
